package simplescenegraph.assets;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public final class FileReader {
	
	public static List<String> readFileLines(String fileName) throws IOException {
		if (fileName == null) {
			throw new IllegalArgumentException();
		}
		
		BufferedReader reader = new BufferedReader(new InputStreamReader(ResourceLoader.getResourceAsStream(fileName)));
		
		List<String> lines = new ArrayList<String>();
		String line;
		while ((line = reader.readLine()) != null) {
			lines.add(line);
		}
		
		return lines;
	}
	
}
